package com.itheima.demo;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet("/myServlet")
public class MyServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //实现refresh关键字跳转功能 响应头API
        //方法具有2个参数  关键字  跳转地址
        //response.setHeader("refresh","5;url=http://www.baidu.com");
        response.setHeader("refresh","3;url=http://www.itcast.cn");
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request, response);
    }
}
